﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace SHomeWorkshop.LunarPresentation.Converts
{
    public class TextFontSizeLevelConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Length == 2)
            {
                double srcFontSize = (double)values[0];
                int srcFontSizeLevel = (int)values[1];

                return srcFontSize + srcFontSize * 0.1 * srcFontSizeLevel;
            }

            return 12;//这是默认字号。
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
